﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections;

namespace GuessGameColors
{
    
    class Randomer
    {
        int random;
        int myRandomNum;
       
        public int Connector
        {
            get;
            set;
        }
        public int fooNum;

        int[] randomArray = new int[1000];
        Random rndm = new Random();
        public void _makeRandomArray()
        {
            
            for (int i = 0; i < randomArray.Length; i++)
            {
                random = rndm.Next(1, 1001);
                randomArray[i] = random;
            }

            //sort the array
            Array.Sort(randomArray);

            //choose a random number
            myRandomNum = randomArray[rndm.Next(0, randomArray.Length)];
            fooNum = myRandomNum;
        }
        public void _GuessTheNumber(int userGuess)
        {
          if (userGuess == myRandomNum)
                Connector = 0;

            else if (Math.Abs(userGuess - myRandomNum) <= 100)
                //prety close 
                Connector = 1;
            else if (Math.Abs(userGuess - myRandomNum) <= 200)
                //close
                Connector = 2;
            else if (Math.Abs(userGuess - myRandomNum) <= 300)
                //not too close
                Connector = 3;
            else if (Math.Abs(userGuess - myRandomNum) <= 400)
                //well you can do better
                Connector = 4;
            else if (Math.Abs(userGuess - myRandomNum) <= 500)
                // kind of half way true
                Connector = 5;
            else if (Math.Abs(userGuess - myRandomNum) <= 600)
                //cold
                Connector = 6;
            else if (Math.Abs(userGuess - myRandomNum) <= 700)
                //cold as shit
                Connector = 7;
            else if (Math.Abs(userGuess - myRandomNum) <= 800)
                //who let the white bears in?
                Connector = 8;
            else if (Math.Abs(userGuess - myRandomNum) <= 900)
                //-272 below zero!
                Connector = 9;
        }
    }
}
